home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Sound Cards
/
Programming Sound Cards.iso
/
sound_76
/
sound.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-01
|
399b
|
33 lines
/* Sounds speaker */
#include <wesson.h>
void sound(int freq, int duration)
{
_asm \
{
mov al, 0B6h
out 43h, al
mov dx, 12h
mov ax, 34DEh
div freq
out 42h, al
mov al, ah
out 42h, al
in al, 61h
or al, 3
out 61h, al
}
delay((clock_t)duration);
_asm \
{
in al, 61h
xor al, 3
out 61h, al
}
}